<?php
  
 // global $domainModus;
   
  
   
/*  $node = "[php_property:node]";
  $nodeUrl = "[php_property:node_url]";
  
  if ($node == "")
    $node = "web";

  if ($nodeUrl == "")
    $nodeUrl = "/web";
    
  $nodeId = db::getValue("SELECT id FROM page WHERE _url='$nodeUrl'");
    
   
   
  /*if ($domainModus) {
      $sql       ="SELECT * FROM page WHERE menu_aktiv = 1 AND _usergroup<=$userGrp
            AND item_parent_id = (SELECT id FROM page WHERE titel = '$node' AND domain='$domain') AND domain='$domain' ORDER BY item_order";
  } else {
  $sql       ="SELECT * FROM page WHERE menu_aktiv = 1 AND _usergroup<=$userGrp
            AND item_parent_id = (SELECT id FROM page WHERE titel = '$node') $domainSql ORDER BY item_order";
  } */
  
/*  $domainSql = "";
  if ($domainModus) 
      $domainSql = " AND domain='$domain'";
  
  
   $sql       ="SELECT * FROM page WHERE menu_aktiv = 1 AND _usergroup<=$userGrp
            AND item_parent_id = $nodeId $domainSql ORDER BY item_order";
  
  
  
  $activeMenu = "[active_menu]";   */
  
  
            
  //$dataMenu = new data();
  //$dataMenu->getQuery($sql);
  //$dataMenu->getQuery("");  
  //$dataMenu = data::getQuery("");
  
  //do {
  //$sqlMenu = "sql";
  
   $nodeUrl = "[php_property:node_url]";
   $level = "[php_property:level]";  
   

  
  
  if ($level == "") {
      if ($nodeUrl == "") {
    $nodeUrl = "/web";
    }
  
  $parentId = db::getValue("SELECT id FROM content WHERE _url='$nodeUrl'");
    
   
  
  
  } else {
        
       
 
 $parentId = -1;
 if (isset(config::$parentList[$level])) {
    $parentId = config::$parentList[$level];
 }
  
        
        
    }
   
   
   
 
  
                                                        //AND _usergroup<=$userGrp 
  /* $sqlMenu       ="SELECT * FROM content,usergroup WHERE _usergroup=usergroup.id AND menu_active = 1 AND usergroup_number<='".config::$userData["usergroup_number"]."'
            AND item_parent_id = '$parentId' ORDER BY item_order";
            
            echo $sqlMenu;*/
   
   
   
   
   
   
   
   
  /*if ($domainModus) {
      $sql       ="SELECT * FROM page WHERE menu_aktiv = 1 AND _usergroup<=$userGrp
            AND item_parent_id = (SELECT id FROM page WHERE titel = '$node' AND domain='$domain') AND domain='$domain' ORDER BY item_order";
  } else {
  $sql       ="SELECT * FROM page WHERE menu_aktiv = 1 AND _usergroup<=$userGrp
            AND item_parent_id = (SELECT id FROM page WHERE titel = '$node') $domainSql ORDER BY item_order";
  } */
  
  $domainSql = "";
  /*if ($domainModus) 
      $domainSql = " AND domain='$domain'"; */
  
  
  $orderBy ="[php_property:orderby]";
  
  
  
  
  
                                                        //AND _usergroup<=$userGrp 
   $sqlMenu       ="SELECT * FROM content,usergroup WHERE _usergroup=usergroup.id AND menu_active = 1 AND usergroup_number<='".config::$userData["usergroup_number"]."'
            AND item_parent_id = '$nodeId' $domainSql ORDER BY item_order";
  
  //echo $sqlMenu;
  
  foreach (db::getQuery($sqlMenu) as $dataquery_menu) {
      
?>